package com.xdf.data_transmitter.controller;

import com.xdf.data_transmitter.service.ClientPushlistDetailService;
import com.xdf.data_transmitter.service.PlanReportService;
import com.xdf.data_transmitter.utils.JsonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@CrossOrigin
@RestController
@RequestMapping("/dev")
public class DevController {
    @Autowired
    private PlanReportService planReportService;

    @Autowired
    private ClientPushlistDetailService clientPushlistDetailService;

    @GetMapping("/refreshStart")
    public JsonResult refreshStart(){
        int ret = planReportService.refreshStart();
        return JsonResult.ok("更新了" + ret + "行数据！");
    }

    @GetMapping("/updateFinished/{lastIId}")
    public JsonResult updateClientPushlistDetailFinished(@PathVariable int lastIId){
        int ret = clientPushlistDetailService.updateFinished(lastIId);
        return JsonResult.ok("更新了" + ret + "行数据");
    }
}
